﻿using System;
using System.Data;
using System.Collections.Generic;
using eTMS.Controllers.GiangVienLopTinChiService;
namespace eTMS.Controllers{
public class GiangVienLopTinChiControllerBase : CommonController{
	public GiangVienLopTinChiControllerBase()
		: base()
	{	
		this.dao = new GiangVienLopTinChiServiceClient();
	}
	protected GiangVienLopTinChiServiceClient dao;
	~GiangVienLopTinChiControllerBase(){
		try{dao.Close();}catch{}
	}
    //Copy data from data row in grid to object
    public GiangVienLopTinChiEntity MapDataRowToObject(DataRow row){
		GiangVienLopTinChiEntity o = new GiangVienLopTinChiEntity();
		 if(!row.IsNull("GiangVien_ID"))
			o.GiangVien_ID=ConvertInt(row["GiangVien_ID"]);
		 if(!row.IsNull("LopTinChi_ID"))
			o.LopTinChi_ID=(Int32)(row["LopTinChi_ID"]);
		 if(!row.IsNull("GiangVienLopTinChi_ID"))
		    o.GiangVienLopTinChi_ID=(Int32)(row["GiangVienLopTinChi_ID"]);
		 return o;
    }
	//Copy data from object to data row in grid    
    public void MapObjectToDataRow(GiangVienLopTinChiEntity o,DataRow row){
		row["GiangVien_ID"]=o.GiangVien_ID;
		row["LopTinChi_ID"]=o.LopTinChi_ID;
		row["GiangVienLopTinChi_ID"]=o.GiangVienLopTinChi_ID;
    }
}
}
